package com.qboot.common.utils;

import cn.hutool.core.util.ObjectUtil;
import com.qboot.common.exception.BusinessException;

/**
 * 断言工具类
 *
 * @author Tellsea
 * @date 2022/11/27
 */
public class AssertUtils {

    public static void isEmpty(Object content, String errorMsg) {
        if (ObjectUtil.isEmpty(content)) {
            throw new BusinessException(errorMsg);
        }
    }

    public static void isTrue(boolean flag, String errorMsg) {
        if (flag) {
            throw new BusinessException(errorMsg);
        }
    }
}
